import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_navigation/get_navigation.dart';

class Back extends StatefulWidget {
  const Back({super.key});

  @override
  State<Back> createState() => _BackState();
}

class _BackState extends State<Back> {

  void _back() {
    Get.back();
  }

  @override
  Widget build(BuildContext context) {
    return Positioned(
        top: MediaQuery.of(context).padding.top + 10,
        left: 20,
        width: 30,
        height: 30,
        child: GestureDetector(
          onTap: _back,
          child: Container(
            width: 30,
            height: 30,
            decoration: const BoxDecoration(
              color: Colors.transparent,
              image: DecorationImage(
                image: AssetImage('assets/icon/back.png'),
                fit: BoxFit.cover,
              ),
            ),
          ),
        )
    );
  }
}
